Optimal. Leaf size=303 \[ \frac {1}{2} a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right ) x+\frac {b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}-\frac {b \left (39 a^2 b B-6 b^3 B+4 a b^2 (11 A-6 C)+4 a^3 (2 A+3 C)\right ) \tan (c+d x)}{6 d}-\frac {b^2 \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec (c+d x) \tan (c+d x)}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.59, antiderivative size = 303, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 5, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {4179, 4133,
3855, 3852, 8} \begin {gather*} \frac {b^2 \left (12 a^2 C+8 a b B+2 A b^2+b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\sin (c+d x) \left (a^2 (4 A+6 C)+15 a b B+12 A b^2\right ) (a+b \sec (c+d x))^2}{6 d}-\frac {b^2 \tan (c+d x) \sec (c+d x) \left (a^2 (4 A+6 C)+18 a b B+3 b^2 (6 A-C)\right )}{6 d}-\frac {b \tan (c+d x) \left (4 a^3 (2 A+3 C)+39 a^2 b B+4 a b^2 (11 A-6 C)-6 b^3 B\right )}{6 d}+\frac {1}{2} a x \left (a^3 B+4 a^2 b (A+2 C)+12 a b^2 B+8 A b^3\right )+\frac {(3 a B+4 A b) \sin (c+d x) \cos (c+d x) (a+b \sec (c+d x))^3}{6 d}+\frac {A \sin (c+d x) \cos ^2(c+d x) (a+b \sec (c+d x))^4}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4133
Rule 4179
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+b \sec (c+d x))^4 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}+\frac {1}{3} \int \cos ^2(c+d x) (a+b \sec (c+d x))^3 \left (4 A b+3 a B+(2 a A+3 b B+3 a C) \sec (c+d x)-b (2 A-3 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}+\frac {1}{6} \int \cos (c+d x) (a+b \sec (c+d x))^2 \left (12 A b^2+15 a b B+a^2 (4 A+6 C)+\left (3 a^2 B+6 b^2 B+4 a b (A+3 C)\right ) \sec (c+d x)-6 b (2 A b+a B-b C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}+\frac {1}{6} \int (a+b \sec (c+d x)) \left (3 \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right )-b \left (8 a A b+3 a^2 B-6 b^2 B-18 a b C\right ) \sec (c+d x)-2 b \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}-\frac {b^2 \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {1}{12} \int \left (6 a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right )+6 b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \sec (c+d x)-2 b \left (39 a^2 b B-6 b^3 B+4 a b^2 (11 A-6 C)+4 a^3 (2 A+3 C)\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {1}{2} a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right ) x+\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}-\frac {b^2 \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {1}{2} \left (b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right )\right ) \int \sec (c+d x) \, dx-\frac {1}{6} \left (b \left (39 a^2 b B-6 b^3 B+4 a b^2 (11 A-6 C)+4 a^3 (2 A+3 C)\right )\right ) \int \sec ^2(c+d x) \, dx\\ &=\frac {1}{2} a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right ) x+\frac {b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}-\frac {b^2 \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec (c+d x) \tan (c+d x)}{6 d}+\frac {\left (b \left (39 a^2 b B-6 b^3 B+4 a b^2 (11 A-6 C)+4 a^3 (2 A+3 C)\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{6 d}\\ &=\frac {1}{2} a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right ) x+\frac {b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\left (12 A b^2+15 a b B+a^2 (4 A+6 C)\right ) (a+b \sec (c+d x))^2 \sin (c+d x)}{6 d}+\frac {(4 A b+3 a B) \cos (c+d x) (a+b \sec (c+d x))^3 \sin (c+d x)}{6 d}+\frac {A \cos ^2(c+d x) (a+b \sec (c+d x))^4 \sin (c+d x)}{3 d}-\frac {b \left (39 a^2 b B-6 b^3 B+4 a b^2 (11 A-6 C)+4 a^3 (2 A+3 C)\right ) \tan (c+d x)}{6 d}-\frac {b^2 \left (18 a b B+3 b^2 (6 A-C)+a^2 (4 A+6 C)\right ) \sec (c+d x) \tan (c+d x)}{6 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 4.70, size = 370, normalized size = 1.22 \begin {gather*} \frac {6 a \left (8 A b^3+a^3 B+12 a b^2 B+4 a^2 b (A+2 C)\right ) (c+d x)-6 b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+6 b^2 \left (2 A b^2+8 a b B+12 a^2 C+b^2 C\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {3 b^4 C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 b^3 (b B+4 a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}-\frac {3 b^4 C}{\left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 b^3 (b B+4 a C) \sin \left (\frac {1}{2} (c+d x)\right )}{\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )}+3 a^2 \left (24 A b^2+16 a b B+a^2 (3 A+4 C)\right ) \sin (c+d x)+3 a^3 (4 A b+a B) \sin (2 (c+d x))+a^4 A \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 284, normalized size = 0.94 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 311, normalized size = 1.03 \begin {gather*} -\frac {4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A a^{4} - 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{4} - 12 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} b - 48 \, {\left (d x + c\right )} C a^{3} b - 72 \, {\left (d x + c\right )} B a^{2} b^{2} - 48 \, {\left (d x + c\right )} A a b^{3} + 3 \, C b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 36 \, C a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 24 \, B a b^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, A b^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{4} \sin \left (d x + c\right ) - 48 \, B a^{3} b \sin \left (d x + c\right ) - 72 \, A a^{2} b^{2} \sin \left (d x + c\right ) - 48 \, C a b^{3} \tan \left (d x + c\right ) - 12 \, B b^{4} \tan \left (d x + c\right )}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.42, size = 262, normalized size = 0.86 \begin {gather*} \frac {6 \, {\left (B a^{4} + 4 \, {\left (A + 2 \, C\right )} a^{3} b + 12 \, B a^{2} b^{2} + 8 \, A a b^{3}\right )} d x \cos \left (d x + c\right )^{2} + 3 \, {\left (12 \, C a^{2} b^{2} + 8 \, B a b^{3} + {\left (2 \, A + C\right )} b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (12 \, C a^{2} b^{2} + 8 \, B a b^{3} + {\left (2 \, A + C\right )} b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, A a^{4} \cos \left (d x + c\right )^{4} + 3 \, C b^{4} + 3 \, {\left (B a^{4} + 4 \, A a^{3} b\right )} \cos \left (d x + c\right )^{3} + 2 \, {\left ({\left (2 \, A + 3 \, C\right )} a^{4} + 12 \, B a^{3} b + 18 \, A a^{2} b^{2}\right )} \cos \left (d x + c\right )^{2} + 6 \, {\left (4 \, C a b^{3} + B b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 543, normalized size = 1.79 \begin {gather*} \frac {3 \, {\left (B a^{4} + 4 \, A a^{3} b + 8 \, C a^{3} b + 12 \, B a^{2} b^{2} + 8 \, A a b^{3}\right )} {\left (d x + c\right )} + 3 \, {\left (12 \, C a^{2} b^{2} + 8 \, B a b^{3} + 2 \, A b^{4} + C b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (12 \, C a^{2} b^{2} + 8 \, B a b^{3} + 2 \, A b^{4} + C b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {6 \, {\left (8 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, C a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, B b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - C b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}} + \frac {2 \, {\left (6 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 36 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 48 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, B a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 12 \, A a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 24 \, B a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, A a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.39, size = 2500, normalized size = 8.25 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________